9. processing and sorting machine modular approach 6

好的,我们成功地编写了四个五个站的代码。
OK, so we managed to write the code for four for five stations.

现在让我们转到最后一个,即磁带站,然后我们将能够看到整个机器的工作情况。
Now let's move on to the last one, the tape station, and then we will be able to see the complete machine working.

因此,让我们做一些与我们在其他 40 个站所做的类似的事情。
So let's do something similar to what we did in 40 other stations.

让我们以萃取站为参考,复制变量,即萃取站的局部变量并将它们粘贴到桌面站上。
Let's take the extraction station as a reference and let's copy the variables, the local variables of the of the extraction station and paste them on the table station.

让我们为状态创建 case 语句,然后再次复制站被禁用的状态零。
Let's create our case statement for the state and let's copy again the state zero in which the station is disabled.

我们将其更改为 10 并移除幻灯片。
Let's change this to 10 and remove the slide.

好的,所以在零状态下,我们被禁用了。
OK, so in a state here in state zero, we are disabled.

让我们看看表站。
Let's look at the table station.

我们实际上有两种驱动,一种用于顺时针移动工作台,一种用于抓取产品。
We have actually two actuation, one to move the table in a clockwise way and one to grab products.

所以在状态零时,我们可以将它们都设置为 false。
So in state zero, we could set them both to false.

所以我们需要这个。
So we will need this.

工作台夹具设置为下降,呃,移动工作台驱动也设置为假。
The table griper set to falls and the, uh, move the table actuation set false as well.

好的,让我们继续进行状态 10,其中我们需要对表执行轰炸程序。
OK, so let's move on to state 10 in which we need to carry out the bombing procedure for the table.

那么我们可以做什么让我们看看这里,移动表以获取状态 10 中的位置。
So what we can do let's see here, move table to pick up position in state ten.

我们需要移动工作台直到到达 PICC 位置。
We need to move the table until we reach the PICC position.

那么让我们看看。
So let's see.

让我们设置移动表。
Let's set move table through.

如果我们得到了。
And if we get.

嗯,那个。
Um, the.

表选择位置,传感器,然后移动表将被设置为下降,所以如果我们已经在那里,当我们获得租户状态时,移动表将被设置为 true,然后在同一策略周期内下降。
Table pick positions, senser, then move table will be set to falls, so if we are already there, when we get the state tenant move table will be set to true and then the falls within the same policy cycle.

所以这就等于说我们根本过不去。
So it is the same as saying that we won't get through at all.

那么接下来我们需要转到另一个状态 state 20 和这里。
So moving on then we need to go to another state state 20 and here.

我们实际上需要等待产品,让我们在这里添加评论。
We will need actually to wait for a product, let's add a comment over here and.

正确的。
Right.

等待产品。
Wait for product.

所以我们在这里要做的是,如果我们在桌子上得到一个产品和三个,那么我们应该去另一个州,并且在这个州应该是 30 号座位。
So what we will do over here is that if we get a product on table and three, then we should go to another state and this should be seat 30 in this state.

对我们来说,等待很重要,我的意思是,这是不正确的,因为如果你还记得在第一台机器中,我们需要等待一段时间才能真正读取颜色传感器。
It is important for us to well, wait, I mean, this is not correct, because if you remember in the first machine, we needed to wait a little bit to, um, actually read the color sensor.

那么我们就到30吧。
So let's get to the 30.

那是对的。
That is correct.

这里我们需要使用一个计时器。
And here we will need to use a timer.

我们将此称为通用计时器,因为我们也将使用它来删除产品。
Let's call this generic timer because we will use it also to drop the product as well.

因此,我们在程序的局部变量中调用这个通用计时器,并显示圣经的类型。
So let's call this generic timer in the local variables of the of the program and the type of the Bible is showing.

让我们通过按 F 进入文本来添加对 Tionne 的调用,搜索并编写计时器,我们将得到一个通用计时器并按。
Let's add the calls for the Tionne below by pressing F to going into text, search and write the timer, we will get a generic timer and press.

好的。
OK.

所以我们逮捕了 30 个,我们需要做的是每次设置通用计时器或不等于抛出一个通用计时器飞镖泥炭,等于,比方说,四秒,零点五秒,然后我们需要等待通用计时器。
So we arrested 30, what we need to do is set the generic timer each and every time or not in equal to throw a generic timer dart peaty, equal to, let's say, four seconds, zero point five seconds, and then we need to wait for the generic timer.

提示。
The cue.

如果我们在该提示处达到退化时间,我们需要首先重置计时器。
If we get to degenerate time at that cue, we need the first to reset the timer.

然后我们需要读取对象的颜色,以便我们有一个颜色变量,我们称之为颜色,这应该是一个保龄球和变量。
And then we need to read the color of the object so that we had a color variable that we would call that we call color, and this shall be a bowling and variable.

在这一点上,当我们进行状态转换时,我们将获得与颜色传感器相同的颜色,然后我们将进入状态 40。
And up in this point, when we are having our state transition, we will have color equal to the color sensor and then we will move on to state 40.

我会在这里添加评论,我会说等待颜色读取。
I will add over here comment that I will say wait for color read.

我将继续到状态 40,而不是 40,我们需要实际开始移动桌子,小桌子。
And I will move on to state 40, instead 40, we need to actually start moving the table, little table.

所以这里如果。
So here if.

我们得到了。
We get.

抱歉,首先我们需要获取产品,所以让我们开始吧。
Sorry, first we need to grab the product, so let's.

将工作台夹具设置为等于真值,并将移动工作台设置为等于。
Set the table griper equal to truth and move table equal to.

所以人们会开始移动,直到我们到达。
So the people will start moving until we reach.

该小组的立场,就像我们对第一个广泛计划所做的那样,如果我们到达红色站并且颜色是红色,或者我们到达蓝色站并且颜色是蓝色,我们将需要丢弃产品,请记住,颜色是一个体积变量, false 表示产品是红色, false 表示产品是蓝色。
The group's position, and in the same way that we did for the first broad program, we will need to drop the product if we get to the red station and the color is red or we get to the blue station and the color is blue, to remember the color is a volume variable and false means that the product is red through means that the product is blue.

所以如果产品是红色的,达到对立的条件不是颜色和表红色滴位置传感器这样。
So if the product is red, the condition to have reached the opposition is not color and the table red drop position sensor this way.

这意味着我们有红色产品,我们处于红色对立面,或者我们有蓝色产品,我们处于谈判桌。
This means that we have a red product and we are at the red opposition or instead we have a blue product and we are at the table.

蓝色命题位置。
Blue proposition position.

如果这些条件之一为真,我们需要做的是禁用停止工作台,应将某些工作台设置为等于下降,并且工作台夹具也应设置为下降。
If one of these conditions is true, what we need to do is disable stop the table, some table should be set equal to falls and the table gripper should be set to fall as well.

让我们再次转到状态 15 和状态。
And let's move to state 15 and the state again.

我们需要等一下才能放下产品。
We need to wait up a second to drop the product.

让我们调用状态,等待产品下降。
Let's call the state, wait for product to drop.

在这里,我们实际上将做与今天没有看到的大部分相同的事情,因为我们需要以半秒启动计时器,然后移动到另一个状态,以便我们可以直接复制并粘贴所有这些代码。
And here we will actually do mostly the same thing that we didn't see today since we need to start the timer with half a second and then move to another state so we can directly copy and paste all this code.

您需要删除代码中的此颜色部分。
You need to remove this color part of the code and.

转到状态 60。
Go to state 60.

所以现在,我们已经达到了产品的定位,我们需要这样做。
So right now, we reached the position for the product and we need to.

然后开始移动桌子并再次移动,直到我们到达。
And start moving the table and back again until we get to.

表和位置,但是我们已经有了这个状态,我们已经统治了它,这个状态就是状态10。
The table and position, but we already have this state, we already ruled it, and this state is state 10.

这样我们就可以直接看到10了。
So we can directly get to see 10.

好的,和其他类似。
OK, similarly to the other.

到了车站,我们需要专人管理紧急停车。
To the station, we need to hand manage the emergency stop.

而且,嗯。
And, um.

并持有巴顿斯。
And hold Bartons.

因此,我们需要从提取站再次复制所有这些代码并将其粘贴到此处并删除最后一个 NKE 语句。
So we need to copy again from the extraction station all of this code and paste it right here and remove the last NKE statement.

好的,那么。
OK, so.

让我们看看我们是否有紧急调酒机。
Let's see if we have an emergency bartending press that we can.

实际上,要使状态为零,我们需要将工作台设置为等于力,并将工作台夹具设置为等于力。
Actually get the state zero and we need to set the table equal to force and the table griper equal to force.

停止状态也是如此,但我们能做的是。
The same goes for the stopping state, but what we can do is.

事实上,如果我们不是的话。
Actually, if we are not.

我们实际上可以停在一个稳定的位置,所以。
We can actually stop in a stable position, so.

假设如果我们幸运的话,我们可以停止任何一个桌子,拿起位置或红色和放下位置。
Let's say that if we are lucky, we can stop either of the table, pick up positions or the red and drop positions.

所以让我们等等吧。
So let's wait.

抱歉,当我们到达停止状态时请听到停止的声明。
Sorry, hear the statement to stop when we get to the stopping state.

当按下停止时,如果我们位于工作台上,拾取位置,传感器位于工作台上方,向上位置传感器或工作台读取命题传感器,那么我们实际上可以停止。
When the press stop is if we are at the table, pick position, sensor over the table, blither up position sensor or the table read proposition sensor, then we can actually stop.

好的。
OK.

这样也好,那么我们就需要管理整个世界,我们唯一需要考虑的就是我们无法开始的状态。
This is fine, then we need to manage the whole world, and the only thing that we need to think about are the states in which we cannot start.

我们无法坚持。
We cannot hold.

这些州就是我们正在移动的州。
And those states are the one in which we are moving the table.

所以。
So.

我会说这是状态,状态10,因为它们正在移回到初始位置。
I will say that this the state, the state 10, because they are moving back to the initial position and.

状态40,那么我们就从这里开始吧,整首歌曲的管理这里在管理所有要求状态应该不等于10并且不等于。
State 40, so let's start here, the management of the whole song here in the management of the all the requests that the state should be not equal to 10 and not equal.

我说40。
I said to 40.

所以实际上,我们应该可以开始了,我们应该已经管理了这里要管理的所有内容,所以让我们进行下载,看看一切是否正常。
So actually, we should be good to go and we should have managed everything that it is there is to manage here, so let's carry out the download and let's see if everything works.

我们应该能够启动机器并看到它从头到尾完美地工作。
We should be able to start the machine and see and see it work flawlessly from the beginning to the end.

所以现在,我们将能够见证所有操作并行发生。
So right now, we shall be able to witness all the operation happening in parallel and.

据打电话的人说,这就是我们实际上还将看到产品被抢劫的地方。
That's all we will also see actually where the products are being robbed, according to their caller.

现在我们只有三个。
Right now we only have three.

我们很幸运。
We are being a lucky.

我们有三个。
We had three.

红色产品表示它们将掉落在同一位置。
Red products that they will be dropped in the same position.

但该表似乎工作正常。
But the table seems to work fine.

整个机器正在工作。
And the whole machine is working.

以完美的方式。
In a flawless way.

所有操作都是并行管理的。
All the operations are managed in parallel.

好的,现在让我们看看一些产品是否掉落在其他位置。
OK, now let's see some product if they are dropped in the other position.

是的,一切都很顺利,所以现在让我们尝试一些按钮,让我们尝试按住 和 。
Yes, everything is going pretty good, so now let's try some of the buttons, let's try to hold and.

并查看它是否正确恢复。
And see if it resumes correctly.

是的,看起来确实如此。
Yes, it very well seems so.

我们可以随时按下它。
We can press it at any time.

和。
And.

在这里发布吧。
Release it here.

好的,让我们尝试使用这个顶部位置来了解消耗表的内容。
OK, let's try with this top position for what consumes the table.

让我们从这里开始吧。
Let's right here on the table start correctly.

这是评估该表的 Omine 过程的最佳开始。
That's the best start to evaluate the Omine procedure of the table.

是的,它有效。
Yes, it works.

另外,让我们尝试一下桌子上的紧急按钮。
And also, let's try the emergency button for the table.

是的,它工作得很好,桌子无论在哪里都会停止,如果我可以重新开始,一切都会停止。
Yes, it works fine, the table stops no matter where it is, and if I can start again, everything.

返回到归位程序。
Gets back to an homing procedure.

好的。
OK.

所以这很好。
So this is fine.

所以我们成功地建造了整台机器。
So we managed to build the overall machine.

在下一个视频中,我们需要对主程序进行一些修改,一些小的修改,因为。
And in the next video, we will need to carry out some modifications, some small modification on the main program because.

正如我告诉过你的,我让你添加这个输入而不是访问全局变量是有原因的。
As I told you, I made you add this input's instead of accessing the global variable for a reason.

现在我们将了解我这样做的原因,然后我们将继续前进并进一步开发模块化机器的软件模式。
Now we will see the reason why I did this, and then we will move on and take another step into developing into software patterns for modular machines.